#include "ScnsSmctp.c.h"

#if defined(SCNS_SMCTP_ENABLE)&&SCNS_SMCTP_ENABLE==1

#include "ScnsMenu.h"
#include "JctoInclude.h"

const ScnsSmctpChanelConfig scnsSmctpChanelConfig[SCNS_SMCTP_CHANNEL_MAX]={
    [SCNS_SMCTP_CHANNEL_MENU]={.callback=scnsMenuReceiveInterrupt},
    
};

JctoSocketHandle socketFd;

ScnsStatus scnsBspSmctpInit(void)
{
#if defined(_WIN32)
    JctoSocketStatus status=jctoSocketOpenTcp(&socketFd,"127.0.0.1",3333);
#elif defined(__APPLE__)||defined(__linux__)
    JctoSocketStatus status=jctoSocketOpenTcp(&socketFd,"192.168.56.1",3333);
#endif
    if(status!=JCTO_SOCKET_STATUS_OK)
    {
        hxPrintfVFL(__file__,(int)__LINE__,"%d\n",status);
        return SCNS_STATUS_BSP_FAILED;
    }
    return SCNS_STATUS_OK;
}

ScnsStatus scnsBspSmctpCanSend(void)
{
    return SCNS_STATUS_OK;
}

int32 scnsBspSmctpSend(const uint8*buf,int32 len)
{
    jctoSocketSend(&socketFd,buf,len);
    return -len;
}

#endif